package com.example.springmysqldemo.dao;

import com.example.springmysqldemo.entity.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class DepartmentDaoimpl implements DepartmentDao{
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Override
    public Department findDeptInfo(String id) {
        String sql = "select * from t_department where uid = ?";
        Department department = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<Department>(Department.class), id);
        return department;
    }
}
